<?php
/**
 * Created by PhpStorm.
 * User: qixiuxiu
 * Date: 2017/3/31
 * Time: 14:22
 */
/*
 * phpunit单元测试脚本*/
require_once 'vendor/phpunit/phpunit/src/Framework/TestCase.php';
class IndexTest extends PHPUnit_Framework_TestCase{
    public function testHello(){
        $_GET['name'] = 'hemu';
       
        ob_start();//打开缓冲区
        include 'index.php';
//        ob_flush();//ob_flush — Flush (send) the output buffer输出缓冲区
        $content = ob_get_clean();//获取当前缓冲区内容并删除当前的输出缓冲区 

        $this->assertEquals('Hello hemu',$content);
    }
}